package com.welab.springcloud.demo.common.autoConfiguration;

import com.welab.springcloud.demo.common.exception.GlobalExceptionHandler;
import com.welab.springcloud.demo.common.interceptor.WebLogAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;


@Configuration
public class AspectAutoConfiguration {
    
    @Bean
    @Order(-5)
    @ConditionalOnClass(WebLogAspect.class)
    @ConditionalOnMissingBean
    @ConditionalOnWebApplication
    public WebLogAspect webLogAspect() {
        return new WebLogAspect();
    }

}
